import { save, deleteById, findById, find } from '@/services/${classInfo.className?lower_case }-api';

export default {
  namespace: '${classInfo.className?lower_case }',

  state: {
    data: {},
  },

  effects: {
    *fetch(_, { call, put }) {
      const response = yield call(find);
      yield put({
        type: 'list',
        payload: response,
      });
    },
  },

  reducers: {
    list(state, action) {
      return {
        ...state,
        data: action.payload,
      };
    },
  },
};
